﻿Imports Display.SRAGWM
Imports System.Drawing

Namespace SRAGWM
    Public Class InitializeMap

        Shared Sub Connect(ByVal DB As Database, ByVal MapServerDetails As MapServer, ByVal CoordinateSystem As String, _
                    ByRef objms As MAPSRVLib.GWMMapServerHelper)

            Dim MapServer As New MS

            objms = MapServer.GetMap()
            objms.Clear()
            objms.OutputType = MapServerDetails.OutputType
            objms.BackgroundColor = RGB(MapServerDetails.BackgroundColor.R, MapServerDetails.BackgroundColor.G, _
                                        MapServerDetails.BackgroundColor.B)

            objms.SetCoordinateSystem(CoordinateSystem)

            objms.Connect(DB.DBType, DB.DBName, DB.Source, DB.ConnectionName)

        End Sub
        'Sub SetMapServer(ByVal pOutputType As String, ByVal pBackgroundColor As Color)

        '    Dim MapS As New SRAGWM.MapServer(pOutputType, pBackgroundColor)

        '    _MapServer = MapS

        'End Sub

        'Sub SetCoordinateSystem(ByVal pCoordinateSystem As String)

        '    Dim CoordSys As New SRAGWM.CoordinateSystem(pCoordinateSystem)

        '    _CoordinateSystem = CoordSys

        'End Sub

        'Sub SetDBConnect(ByVal pDBType As String, ByVal pDBName As String, _
        '                 ByVal pSource As String, ByVal pConnectionName As String)

        '    Dim DBConnection As New SRAGWM.DBConnect(pDBType, pDBName, pSource, pConnectionName)

        '    _DBConnect = DBConnection

        'End Sub


    End Class
End Namespace